<?php

/**
 * Recuit filter form base class.
 *
 * @package    appcemhti
 * @subpackage filter
 * @author     Steve Cancès
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseRecuitFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_controle_atmosphere' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ControleAtmosphere'), 'add_empty' => true)),
      'tempmax'                => new sfWidgetFormFilterInput(),
      'rampe_montee'           => new sfWidgetFormFilterInput(),
      'rampe_descente'         => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'id_controle_atmosphere' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('ControleAtmosphere'), 'column' => 'id_controle_atmosphere')),
      'tempmax'                => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'rampe_montee'           => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'rampe_descente'         => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('recuit_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Recuit';
  }

  public function getFields()
  {
    return array(
      'id_traitement'          => 'Number',
      'id_controle_atmosphere' => 'ForeignKey',
      'tempmax'                => 'Number',
      'rampe_montee'           => 'Number',
      'rampe_descente'         => 'Number',
    );
  }
}
